package com.dragon.modules.yuegou.query.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.system.DocumentEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 文档 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-05-14 15:42:12
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class DocumentQuery extends DocumentEntity implements Query<DocumentEntity> {

	private static final long serialVersionUID = 1L;


    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 文件名查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "url")
	private Condition<String> urlCondition;

    /** 文件大小（字节数），-1表示大小位置查询条件 */
	@JsonUnwrapped(prefix = "contentLength")
	private Condition<Long> contentLengthCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "contentType")
	private Condition<String> contentTypeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "contentEncoding")
	private Condition<String> contentEncodingCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "contentMd5")
	private Condition<String> contentMd5Condition;

    /** 文件格式，例如png，doc，xlsx等查询条件 */
	@JsonUnwrapped(prefix = "fileFormat")
	private Condition<String> fileFormatCondition;

    /** 是否是临时文件查询条件 */
	@JsonUnwrapped(prefix = "temp")
	private Condition<Boolean> tempCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 是否已删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public DocumentQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public DocumentQuery(DocumentEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public DocumentQuery(DocumentQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if(other.urlCondition != null) {
			this.urlCondition = other.urlCondition.copy();
		}
		if(other.contentLengthCondition != null) {
			this.contentLengthCondition = other.contentLengthCondition.copy();
		}
		if(other.contentTypeCondition != null) {
			this.contentTypeCondition = other.contentTypeCondition.copy();
		}
		if(other.contentEncodingCondition != null) {
			this.contentEncodingCondition = other.contentEncodingCondition.copy();
		}
		if(other.contentMd5Condition != null) {
			this.contentMd5Condition = other.contentMd5Condition.copy();
		}
		if(other.fileFormatCondition != null) {
			this.fileFormatCondition = other.fileFormatCondition.copy();
		}
		if(other.tempCondition != null) {
			this.tempCondition = other.tempCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<DocumentEntity> toQueryWrapper() {
		QueryWrapper<DocumentEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (urlCondition != null) {
			urlCondition.toWrapper(wrapper, COL_URL);
		}
		if (contentLengthCondition != null) {
			contentLengthCondition.toWrapper(wrapper, COL_CONTENT_LENGTH);
		}
		if (contentTypeCondition != null) {
			contentTypeCondition.toWrapper(wrapper, COL_CONTENT_TYPE);
		}
		if (contentEncodingCondition != null) {
			contentEncodingCondition.toWrapper(wrapper, COL_CONTENT_ENCODING);
		}
		if (contentMd5Condition != null) {
			contentMd5Condition.toWrapper(wrapper, COL_CONTENT_MD5);
		}
		if (fileFormatCondition != null) {
			fileFormatCondition.toWrapper(wrapper, COL_FILE_FORMAT);
		}
		if (tempCondition != null) {
			tempCondition.toWrapper(wrapper, COL_TEMP);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		return wrapper;
	}

	
	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回文件名查询条件
	 * 
	 * @return nameCondition 文件名查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取文件名查询条件
	 * 
	 * @return nameCondition 文件名查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置文件名查询条件
	 * 
	 * @param nameCondition 文件名查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return urlCondition 查询条件
	 */
	public Condition<String> url() {
		this.urlCondition = new Condition<>();
		return this.urlCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return urlCondition 查询条件
	 */
	public Condition<String> getUrlCondition() {
		return urlCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param urlCondition 查询条件
	 */
	public void setUrlCondition(Condition<String> urlCondition) {
		this.urlCondition = urlCondition;
	}

	/**
	 * 构造并返回文件大小（字节数），-1表示大小位置查询条件
	 * 
	 * @return contentLengthCondition 文件大小（字节数），-1表示大小位置查询条件
	 */
	public Condition<Long> contentLength() {
		this.contentLengthCondition = new Condition<>();
		return this.contentLengthCondition;
	}
	
	/**
	 * 获取文件大小（字节数），-1表示大小位置查询条件
	 * 
	 * @return contentLengthCondition 文件大小（字节数），-1表示大小位置查询条件
	 */
	public Condition<Long> getContentLengthCondition() {
		return contentLengthCondition;
	}

	/**
	 * 设置文件大小（字节数），-1表示大小位置查询条件
	 * 
	 * @param contentLengthCondition 文件大小（字节数），-1表示大小位置查询条件
	 */
	public void setContentLengthCondition(Condition<Long> contentLengthCondition) {
		this.contentLengthCondition = contentLengthCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return contentTypeCondition 查询条件
	 */
	public Condition<String> contentType() {
		this.contentTypeCondition = new Condition<>();
		return this.contentTypeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return contentTypeCondition 查询条件
	 */
	public Condition<String> getContentTypeCondition() {
		return contentTypeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param contentTypeCondition 查询条件
	 */
	public void setContentTypeCondition(Condition<String> contentTypeCondition) {
		this.contentTypeCondition = contentTypeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return contentEncodingCondition 查询条件
	 */
	public Condition<String> contentEncoding() {
		this.contentEncodingCondition = new Condition<>();
		return this.contentEncodingCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return contentEncodingCondition 查询条件
	 */
	public Condition<String> getContentEncodingCondition() {
		return contentEncodingCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param contentEncodingCondition 查询条件
	 */
	public void setContentEncodingCondition(Condition<String> contentEncodingCondition) {
		this.contentEncodingCondition = contentEncodingCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return contentMd5Condition 查询条件
	 */
	public Condition<String> contentMd5() {
		this.contentMd5Condition = new Condition<>();
		return this.contentMd5Condition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return contentMd5Condition 查询条件
	 */
	public Condition<String> getContentMd5Condition() {
		return contentMd5Condition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param contentMd5Condition 查询条件
	 */
	public void setContentMd5Condition(Condition<String> contentMd5Condition) {
		this.contentMd5Condition = contentMd5Condition;
	}

	/**
	 * 构造并返回文件格式，例如png，doc，xlsx等查询条件
	 * 
	 * @return fileFormatCondition 文件格式，例如png，doc，xlsx等查询条件
	 */
	public Condition<String> fileFormat() {
		this.fileFormatCondition = new Condition<>();
		return this.fileFormatCondition;
	}
	
	/**
	 * 获取文件格式，例如png，doc，xlsx等查询条件
	 * 
	 * @return fileFormatCondition 文件格式，例如png，doc，xlsx等查询条件
	 */
	public Condition<String> getFileFormatCondition() {
		return fileFormatCondition;
	}

	/**
	 * 设置文件格式，例如png，doc，xlsx等查询条件
	 * 
	 * @param fileFormatCondition 文件格式，例如png，doc，xlsx等查询条件
	 */
	public void setFileFormatCondition(Condition<String> fileFormatCondition) {
		this.fileFormatCondition = fileFormatCondition;
	}

	/**
	 * 构造并返回是否是临时文件查询条件
	 * 
	 * @return tempCondition 是否是临时文件查询条件
	 */
	public Condition<Boolean> temp() {
		this.tempCondition = new Condition<>();
		return this.tempCondition;
	}
	
	/**
	 * 获取是否是临时文件查询条件
	 * 
	 * @return tempCondition 是否是临时文件查询条件
	 */
	public Condition<Boolean> getTempCondition() {
		return tempCondition;
	}

	/**
	 * 设置是否是临时文件查询条件
	 * 
	 * @param tempCondition 是否是临时文件查询条件
	 */
	public void setTempCondition(Condition<Boolean> tempCondition) {
		this.tempCondition = tempCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回是否已删除查询条件
	 * 
	 * @return delCondition 是否已删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取是否已删除查询条件
	 * 
	 * @return delCondition 是否已删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置是否已删除查询条件
	 * 
	 * @param delCondition 是否已删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

}
